package tpo.lmhprovider.lmhprovider.controller;

import api.wares.LabelApi;
import dto.Dto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import pojo.Label;
import tpo.lmhprovider.lmhprovider.service.LabelService;

import java.util.List;
import java.util.Map;

@RestController
public class LabelController implements LabelApi {
    @Autowired
    LabelService labelService;
    @Override
    public Dto<List<Label>> getLabel(Map map) {
        Dto dto=new Dto();
        dto.setObj(labelService.getLabel(map));
        return dto;
    }

    @Override
    public Dto<Integer> delLabel(Map map) {
        Dto dto=new Dto();
        dto.setObj(labelService.delLabel(map));
        return dto;
    }

    @Override
    public Dto<Integer> addLabel(Map map) {
        Dto dto=new Dto();
        dto.setObj(labelService.addLabel(map));
        return dto;
    }

    @Override
    public Dto<Integer> updateLabel(Map map) {
        Dto dto=new Dto();
        dto.setObj(labelService.updateLabel(map));
        return dto;
    }
}
